Repository navigation
Conversation
Signed-off-by: Yunpei Zhou <Joob1n@outlook.com>
lxy-9602
reviewed
Dec 4, 2026
| const std::map<std::string, std::string>& options, | ||
| const std::shared_ptr<FileSystem>& file_system = nullptr, | ||
| const std::map<std::string, std::string>& fs_scheme_to_identifier_map = {}); | ||
| }; |
Member
There was a problem hiding this comment.
I have a suggestion: if it doesn’t affect interface compatibility, could we remove the default parameters?
| {CatalogOptions::METASTORE, TestCatalogFactory::IDENTIFIER}, {"test.fail", "boom"}}; | ||
| ASSERT_NOK_WITH_MSG(Catalog::Create("/tmp/wh", options).status(), | ||
| "custom catalog failure: boom"); | ||
| } |
Member
There was a problem hiding this comment.
Just use ASSERT_NOK_WITH_MSG(Func(), "error msg"); there’s no need to write Func().status().
lxy-9602
marked this pull request as draft
December 4, 2026 13:21
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Make
paimon::Catalog::Createextensible via a pluggableCatalogFactoryregistered withFactoryCreator/REGISTER_PAIMON_FACTORY, matching the existing factory extension pattern used forFileSystemFactory,FileFormatFactory, andCredentialProviderFactory.Previously,
Catalog::Createhardcoded dispatch only for"filesystem"and"rest"metastores and rejected any otherCatalogOptions::METASTOREvalue. External distributed engines (such as StarRocks, where the frontend manages HMS/external catalog metadata and workers receive resolved table locations) can now register a customCatalogFactoryand select it viaCatalogOptions::METASTORE.Summary of changes:
paimon::CatalogFactory(include/paimon/catalog/catalog_factory.h) deriving frompaimon::Factory, with virtualCreate(...)and staticGet(...)lookup throughFactoryCreator."filesystem"(FileSystemCatalogFactory) and"rest"(RestCatalogFactoryunderPAIMON_ENABLE_REST) factories insrc/paimon/core/catalog/catalog_factory.cpp, preserving"PAIMON_ENABLE_REST=ON"and"unsupported metastore"errors.Catalog::Createinsrc/paimon/core/catalog/catalog.cppto dispatch normalized (lowercased) metastore identifiers viaCatalogFactory::Get.Tests
Added
src/paimon/core/catalog/catalog_factory_test.cpp:"filesystem"catalog resolution viaCatalogFactory::GetandCatalog::Create(default,"filesystem", and case-insensitive"FileSystem").CatalogFactoryregistration and dispatch (exact identifier viaCatalogFactory::Getand case-normalizedCatalogOptions::METASTOREviaCatalog::Create), verifying forwarding ofroot_path,options,file_system, andfs_scheme_to_identifier_map.dynamic_cast<CatalogFactory*>), factory creation failures, nullCatalogreturns, andmetastore=restwhenPAIMON_ENABLE_RESTis disabled.InternalReadContext::CreateDependencyCatalogContext(), verifying that custommetastoreand options dispatch back to the customCatalogFactoryviaCatalog::Create.Existing
CatalogTestandRestCatalogTest(includingRestCatalogTest.CatalogFactoryMetastoreDispatch) remain covered.API and Format
include/paimon/catalog/catalog_factory.h(PAIMON_EXPORT class CatalogFactory : public Factory).Catalog::Createdocstring ininclude/paimon/catalog/catalog.hto documentCatalogFactorydispatch.Documentation
paimon::CatalogFactorytodocs/source/api/catalog.rst.FactoryCreatoridentifier-space rules indocs/source/user_guide/catalog.rst.